import request from "@/utils/http";

// 根据订单id查询订单
export function queryOrderByIdAPI(orderId) {
    return request({
        url: `/orders/${orderId}`,
        method: 'get'
    });
}


//根据订单ID查询详细订单
export function getDetailByOrderIdAPI(orderId) {
    return request({
        url: '/orders/getDetailByOrderId',
        method: 'get',
        params:{order_id:orderId}
    });
}


export function queryOrderByUserIdAPI() {
    return request({
        url: `/orders`,
        method: 'get'
    });
}


// 创建订单
export function createOrderAPI(orderFormDTO) {
    return request({
        url: '/orders',
        method: 'post',
        data: orderFormDTO
    });
}

// 标记订单已支付
export function markOrderPaySuccessAPI(orderId) {
    return request({
        url: `/orders/${orderId}`,
        method: 'put'
    });
}
